package com.kate.mall.order.feign;

import com.kate.mall.common.utils.R;
import com.kate.mall.order.dto.GrouponDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Description: 用一句话描述
 * @Auther: 新梦想*陈超
 * @Date: 2021/10/30 23:09
 */
@FeignClient("promotion-center")
public interface PromotionFeignClient {

    @RequestMapping("/promotion/promotionactivity/info/{id}")
    R getById(@PathVariable("id") Integer promotionActivityId);
    @GetMapping("/promotion/promotionactivitygoodsrelation/goodsId")
    R findActivityId(@RequestParam("goods_id") Integer goodsId);

    @GetMapping("/promotion/grouponrules/info/{id}")
    R queryById(@PathVariable("id") Integer grouponRulesId);

    @GetMapping("/promotion/grouponrules/checkExpire")
    boolean isExpired(@RequestParam("grouponRulesId") Integer grouponRulesId);


    @RequestMapping("/promotion/groupon/record/{id}")
    R record(Integer id);

    @RequestMapping("/promotion/groupon/save")
    public R createGroupon(@RequestBody Map grouponMap);
    @RequestMapping("/promotion/groupon/list")
    R queryGrouponByOrderId(@RequestParam(required = false) Map<String, Object> params);

    @RequestMapping("/promotion/groupon/update")
    R updateGroupon(@RequestBody GrouponDTO grouponDTO);
}
